Skip to content

feat(new-repo): ship a self-testing privacy-guard pre-commit hook - #38

Merged
PBNZ merged 2 commits into
mainfrom
feat/34-privacy-guard
Aug 13, 2026
Merged

feat(new-repo): ship a self-testing privacy-guard pre-commit hook#38
PBNZ merged 2 commits into
mainfrom
feat/34-privacy-guard

Conversation

@PBNZ

@PBNZ PBNZ commented Aug 13, 2026

Copy link
Copy Markdown
Owner

What & why

Hand-rolled name guards fail silently — the motivating field case passed everything, including a staged test leak, because of a GNU BRE quoting subtlety. Core now ships scripts/install-privacy-guard.ps1: patterns are case-insensitive literals (not regexes) entered locally and written only into .git/hooks/ (sh shim + generated pwsh guard), never the tree; a configured core.hooksPath refuses the install since it could be tracked; block messages name patterns by index so transcripts never spell the secret. Every install ends with a mandatory negative test in a throwaway fixture — clean stage passes; content leak, filename leak, and real-name identity each blocked — and removes the hook on any failure: a guard that has never failed a negative test is not yet a guard. Documented in the standard's Author identity and the pre-commit checklist; decided in ADR-0012; smoke-tested end-to-end through real git commit runs in CI (new smoke-privacy-guard job).

Refs #34

Checklist

  • One concern per PR (split unrelated changes).
  • Driving issue referenced as Refs #NN (no auto-close keywords), if the repo tracks issues.
  • Conventional Commit title (e.g. feat: …, fix: …, docs: …).
  • CHANGELOG.md updated under ## [Unreleased] if user-visible.
  • Validation passes locally (python scripts/*.py; see .github/workflows/validate.yml).
  • An ADR added under docs/adr/ for any notable decision.

🤖 Generated with Claude Code

https://claude.ai/code/session_013g4xpqBjwwzfqtKyEHuWUr

#34)

Hand-rolled name guards fail silently - the motivating field case passed
everything, including a staged test leak, because of a GNU BRE quoting
subtlety. Core now ships scripts/install-privacy-guard.ps1: patterns are
case-insensitive literals (not regexes) entered locally and written only
into .git/hooks/ (sh shim + generated pwsh guard), never the tree; a
configured core.hooksPath refuses the install since it could be tracked;
block messages name patterns by index so transcripts never spell the
secret. Every install ends with a mandatory negative test in a throwaway
fixture - clean stage passes, content leak, filename leak, and real-name
identity each blocked - and removes the hook on any failure: a guard
that has never failed a negative test is not yet a guard. Documented in
the standard's Author identity and the pre-commit checklist; decided in
ADR-0012; smoke-tested end-to-end through real git commits in CI.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013g4xpqBjwwzfqtKyEHuWUr
PBNZ added a commit that referenced this pull request Aug 13, 2026
@PBNZ
PBNZ merged commit 84d9959 into main Aug 13, 2026
7 checks passed
@PBNZ
PBNZ deleted the feat/34-privacy-guard branch August 13, 2026 08:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant